package com.wandian.demo.ui
{
	import flash.display.BitmapData;
	import flash.display.Graphics;
	import flash.display.Sprite;
	import flash.filters.GlowFilter;
	import flash.text.TextField;
	import flash.text.TextFormat;
	
	import utils.GDI;
	import utils.Res;
	import utils.UIHelper;

	public class SmallBetImage extends Sprite
	{
		private var _smallBetName:String;
		private var _smallBetBitMap:BitmapData;
		private var _tip_GameBetResult:TextField=new TextField();
		public function SmallBetImage(smallBetName:String, sx:int=0, sy:int=0)
		{
			super();
			this._smallBetName=smallBetName;
			this.x=sx;
			this.y=sy;
			drawImage();
			var _textFormat:TextFormat=new TextFormat("宋体", 12, 0x232334);
			var filter:Array=[new GlowFilter(0X778899,0.5,2,2,255)];
			_tip_GameBetResult=UIHelper.addTextFieldChild(this,smallBetName,_tip_GameBetResult,0,0,false,_textFormat,filter);			
		}

		private function drawImage():void
		{
			// TODO Auto Generated method stub
			var g:Graphics=this.graphics;
			g.clear();
			_smallBetBitMap=Res.get(this._smallBetName);
			if (_smallBetBitMap == null)
			{
				return;
			}
			;

			GDI.drawBitmapData(g, 0, 0, _smallBetBitMap);
		}

		public function get smallBetName():String
		{
			return _smallBetName;
		}

		public function set smallBetName(value:String):void
		{

			if (_smallBetName != value)
			{				_smallBetName=value;
				drawImage();
			}

		}

	}
}
